package com.rlz.base.weiget;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.rlz.base.R;
import com.rlz.base.databinding.DialogProgressbarBinding;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.DialogFragment;

/**
 * Created by RLZ
 * on 2021/4/22
 */
public class ProgressDialog extends DialogFragment {


    private DialogProgressbarBinding mBinding;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mBinding = DataBindingUtil.inflate(inflater, R.layout.dialog_progressbar, container, false);
        setCancelable(false);
        return mBinding.getRoot();
    }


    public NumberProgressBar getNumberBar() {
        return mBinding.numberbar;
    }

    public void setNumberBar(int progress) {
        mBinding.numberbar.setProgress(progress);
    }

    public void setTitle(String cur, String total) {
        String resultStr = cur + total;
        mBinding.size.setText(resultStr);
    }
}
